<template>
  <div>
    <div class="outer">
      <h2>List</h2>
      <!-- 发送数据 -->
      <button @click="sendDataToParent">点击想父组件发送数据</button>
    </div>
  </div>
</template>

<script>
export default {
  name: "List",
  data() {
    return {
      list: [
        { name: "海绵宝宝", age: 18 },
        { name: "派大星", age: 19 },
        { name: "章鱼哥", age: 20 },
      ],
    }
  },
  methods: {
    sendDataToParent(){
      this.$emit("atguigu", this.list)
    }
  },
};
</script>

<style scoped>
.outer {
  height: 200px;
  margin: 30px;
  background: pink;
}
</style>